import { goodcate } from '@/api/good'


const state = {
    catelist:[]
}

const mutations = {
    update:(state,payload)=>{
        state.catelist = payload
        state.catelist = JSON.parse(JSON.stringify(state.catelist))

        

    }
    
}
const actions = {
    Getcates({commit}){
        goodcate({}).then(res=>{
            console.log(res);
            const { list } = res.data
            commit('update',list)

        })
    }

    
}
export default {
    namespaced: true,
    state,
    mutations,
    actions
  }
  